3.24.73 \(\int \frac {(d+e x)^2 (f+g x)}{(a+b x+c x^2)^3} \, dx\) [2373]

3.24.73.1 Optimal result
3.24.73.2 Mathematica [A] (verified)
3.24.73.3 Rubi [A] (verified)
3.24.73.4 Maple [B] (verified)
3.24.73.5 Fricas [B] (verification not implemented)
3.24.73.6 Sympy [B] (verification not implemented)
3.24.73.7 Maxima [F(-2)]
3.24.73.8 Giac [B] (verification not implemented)
3.24.73.9 Mupad [B] (verification not implemented)

3.24.73.1 Optimal result

Integrand size = 25, antiderivative size = 305 \[ \int \frac {(d+e x)^2 (f+g x)}{\left (a+b x+c x^2\right )^3} \, dx=-\frac {(d+e x)^2 (b f-2 a g+(2 c f-b g) x)}{2 \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}-\frac {8 a c e (2 c d f+a e g)-6 b c \left (c d^2 f+a e (e f+2 d g)\right )+b^2 \left (a e^2 g+c d (2 e f+3 d g)\right )-\left (12 c^3 d^2 f-b^3 e^2 g-2 b c e (a e g-2 b (e f+d g))-2 c^2 (2 a e (e f-2 d g)+3 b d (2 e f+d g))\right ) x}{2 c \left (b^2-4 a c\right )^2 \left (a+b x+c x^2\right )}-\frac {2 \left (6 c^2 d^2 f+b e (b e f+2 b d g-3 a e g)-c (3 b d (2 e f+d g)-2 a e (e f+2 d g))\right ) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{5/2}} \]

output
-1/2*(e*x+d)^2*(b*f-2*a*g+(-b*g+2*c*f)*x)/(-4*a*c+b^2)/(c*x^2+b*x+a)^2+1/2 
*(-8*a*c*e*(a*e*g+2*c*d*f)+6*b*c*(c*d^2*f+a*e*(2*d*g+e*f))-b^2*(a*e^2*g+c* 
d*(3*d*g+2*e*f))+(12*c^3*d^2*f-b^3*e^2*g-2*b*c*e*(a*e*g-2*b*(d*g+e*f))-2*c 
^2*(2*a*e*(-2*d*g+e*f)+3*b*d*(d*g+2*e*f)))*x)/c/(-4*a*c+b^2)^2/(c*x^2+b*x+ 
a)-2*(6*c^2*d^2*f+b*e*(-3*a*e*g+2*b*d*g+b*e*f)-c*(3*b*d*(d*g+2*e*f)-2*a*e* 
(2*d*g+e*f)))*arctanh((2*c*x+b)/(-4*a*c+b^2)^(1/2))/(-4*a*c+b^2)^(5/2)
 
3.24.73.2 Mathematica [A] (verified)

Time = 0.41 (sec) , antiderivative size = 408, normalized size of antiderivative = 1.34 \[ \int \frac {(d+e x)^2 (f+g x)}{\left (a+b x+c x^2\right )^3} \, dx=\frac {1}{2} \left (\frac {-b^4 e^2 g+b^3 c e (e f+2 d g)+4 c^2 \left (-4 a^2 e^2 g+3 c^2 d^2 f x+a c e (e f+2 d g) x\right )+2 b c^2 (3 c d (d f-2 e f x-d g x)+a e (e f+2 d g-3 e g x))+b^2 c \left (5 a e^2 g+c \left (-6 d e f-3 d^2 g+2 e^2 f x+4 d e g x\right )\right )}{c^2 \left (b^2-4 a c\right )^2 (a+x (b+c x))}+\frac {-b^3 e^2 g x+b^2 e (-a e g+c (e f+2 d g) x)+b c (c d (d f-2 e f x-d g x)+a e (e f+2 d g+3 e g x))+2 c \left (a^2 e^2 g+c^2 d^2 f x-a c \left (d^2 g+e^2 f x+2 d e (f+g x)\right )\right )}{c^2 \left (-b^2+4 a c\right ) (a+x (b+c x))^2}+\frac {4 \left (6 c^2 d^2 f-3 b c d (2 e f+d g)+2 a c e (e f+2 d g)+b e (b e f+2 b d g-3 a e g)\right ) \arctan \left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\left (-b^2+4 a c\right )^{5/2}}\right ) \]

input
Integrate[((d + e*x)^2*(f + g*x))/(a + b*x + c*x^2)^3,x]
 
output
((-(b^4*e^2*g) + b^3*c*e*(e*f + 2*d*g) + 4*c^2*(-4*a^2*e^2*g + 3*c^2*d^2*f 
*x + a*c*e*(e*f + 2*d*g)*x) + 2*b*c^2*(3*c*d*(d*f - 2*e*f*x - d*g*x) + a*e 
*(e*f + 2*d*g - 3*e*g*x)) + b^2*c*(5*a*e^2*g + c*(-6*d*e*f - 3*d^2*g + 2*e 
^2*f*x + 4*d*e*g*x)))/(c^2*(b^2 - 4*a*c)^2*(a + x*(b + c*x))) + (-(b^3*e^2 
*g*x) + b^2*e*(-(a*e*g) + c*(e*f + 2*d*g)*x) + b*c*(c*d*(d*f - 2*e*f*x - d 
*g*x) + a*e*(e*f + 2*d*g + 3*e*g*x)) + 2*c*(a^2*e^2*g + c^2*d^2*f*x - a*c* 
(d^2*g + e^2*f*x + 2*d*e*(f + g*x))))/(c^2*(-b^2 + 4*a*c)*(a + x*(b + c*x) 
)^2) + (4*(6*c^2*d^2*f - 3*b*c*d*(2*e*f + d*g) + 2*a*c*e*(e*f + 2*d*g) + b 
*e*(b*e*f + 2*b*d*g - 3*a*e*g))*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/(- 
b^2 + 4*a*c)^(5/2))/2
 
3.24.73.3 Rubi [A] (verified)

Time = 0.52 (sec) , antiderivative size = 315, normalized size of antiderivative = 1.03, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {1234, 1224, 1083, 219}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(d+e x)^2 (f+g x)}{\left (a+b x+c x^2\right )^3} \, dx\)

\(\Big \downarrow \) 1234

\(\displaystyle -\frac {\int \frac {(d+e x) (6 c d f-2 b e f-3 b d g+4 a e g+e (2 c f-b g) x)}{\left (c x^2+b x+a\right )^2}dx}{2 \left (b^2-4 a c\right )}-\frac {(d+e x)^2 (-2 a g+x (2 c f-b g)+b f)}{2 \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}\)

\(\Big \downarrow \) 1224

\(\displaystyle -\frac {\frac {-x \left (-2 c^2 (2 a e (e f-2 d g)+3 b d (d g+2 e f))-2 b c e (a e g-2 b (d g+e f))+b^3 \left (-e^2\right ) g+12 c^3 d^2 f\right )+b^2 \left (a e^2 g+c d (3 d g+2 e f)\right )-6 b c \left (a e (2 d g+e f)+c d^2 f\right )+8 a c e (a e g+2 c d f)}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}-\frac {2 \left (b e (-3 a e g+2 b d g+b e f)+2 a c e (2 d g+e f)-3 b c d (d g+2 e f)+6 c^2 d^2 f\right ) \int \frac {1}{c x^2+b x+a}dx}{b^2-4 a c}}{2 \left (b^2-4 a c\right )}-\frac {(d+e x)^2 (-2 a g+x (2 c f-b g)+b f)}{2 \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}\)

\(\Big \downarrow \) 1083

\(\displaystyle -\frac {\frac {4 \left (b e (-3 a e g+2 b d g+b e f)+2 a c e (2 d g+e f)-3 b c d (d g+2 e f)+6 c^2 d^2 f\right ) \int \frac {1}{b^2-(b+2 c x)^2-4 a c}d(b+2 c x)}{b^2-4 a c}+\frac {-x \left (-2 c^2 (2 a e (e f-2 d g)+3 b d (d g+2 e f))-2 b c e (a e g-2 b (d g+e f))+b^3 \left (-e^2\right ) g+12 c^3 d^2 f\right )+b^2 \left (a e^2 g+c d (3 d g+2 e f)\right )-6 b c \left (a e (2 d g+e f)+c d^2 f\right )+8 a c e (a e g+2 c d f)}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}}{2 \left (b^2-4 a c\right )}-\frac {(d+e x)^2 (-2 a g+x (2 c f-b g)+b f)}{2 \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}\)

\(\Big \downarrow \) 219

\(\displaystyle -\frac {\frac {4 \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (b e (-3 a e g+2 b d g+b e f)+2 a c e (2 d g+e f)-3 b c d (d g+2 e f)+6 c^2 d^2 f\right )}{\left (b^2-4 a c\right )^{3/2}}+\frac {-x \left (-2 c^2 (2 a e (e f-2 d g)+3 b d (d g+2 e f))-2 b c e (a e g-2 b (d g+e f))+b^3 \left (-e^2\right ) g+12 c^3 d^2 f\right )+b^2 \left (a e^2 g+c d (3 d g+2 e f)\right )-6 b c \left (a e (2 d g+e f)+c d^2 f\right )+8 a c e (a e g+2 c d f)}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}}{2 \left (b^2-4 a c\right )}-\frac {(d+e x)^2 (-2 a g+x (2 c f-b g)+b f)}{2 \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}\)

input
Int[((d + e*x)^2*(f + g*x))/(a + b*x + c*x^2)^3,x]
 
output
-1/2*((d + e*x)^2*(b*f - 2*a*g + (2*c*f - b*g)*x))/((b^2 - 4*a*c)*(a + b*x 
 + c*x^2)^2) - ((8*a*c*e*(2*c*d*f + a*e*g) - 6*b*c*(c*d^2*f + a*e*(e*f + 2 
*d*g)) + b^2*(a*e^2*g + c*d*(2*e*f + 3*d*g)) - (12*c^3*d^2*f - b^3*e^2*g - 
 2*b*c*e*(a*e*g - 2*b*(e*f + d*g)) - 2*c^2*(2*a*e*(e*f - 2*d*g) + 3*b*d*(2 
*e*f + d*g)))*x)/(c*(b^2 - 4*a*c)*(a + b*x + c*x^2)) + (4*(6*c^2*d^2*f - 3 
*b*c*d*(2*e*f + d*g) + 2*a*c*e*(e*f + 2*d*g) + b*e*(b*e*f + 2*b*d*g - 3*a* 
e*g))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(b^2 - 4*a*c)^(3/2))/(2*(b^2 
 - 4*a*c))
 

3.24.73.3.1 Defintions of rubi rules used

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 1083
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2   Subst[I 
nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, 
x]
 

rule 1224
Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*( 
x_)^2)^(p_), x_Symbol] :> Simp[(-(2*a*c*(e*f + d*g) - b*(c*d*f + a*e*g) - ( 
b^2*e*g - b*c*(e*f + d*g) + 2*c*(c*d*f - a*e*g))*x))*((a + b*x + c*x^2)^(p 
+ 1)/(c*(p + 1)*(b^2 - 4*a*c))), x] - Simp[(b^2*e*g*(p + 2) - 2*a*c*e*g + c 
*(2*c*d*f - b*(e*f + d*g))*(2*p + 3))/(c*(p + 1)*(b^2 - 4*a*c))   Int[(a + 
b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && LtQ[p, - 
1] &&  !(IntegerQ[p] && NeQ[a, 0] && NiceSqrtQ[b^2 - 4*a*c])
 

rule 1234
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(d + e*x)^m*(a + b*x + c*x^2)^(p + 1)*( 
(f*b - 2*a*g + (2*c*f - b*g)*x)/((p + 1)*(b^2 - 4*a*c))), x] + Simp[1/((p + 
 1)*(b^2 - 4*a*c))   Int[(d + e*x)^(m - 1)*(a + b*x + c*x^2)^(p + 1)*Simp[g 
*(2*a*e*m + b*d*(2*p + 3)) - f*(b*e*m + 2*c*d*(2*p + 3)) - e*(2*c*f - b*g)* 
(m + 2*p + 3)*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && LtQ[p, -1 
] && GtQ[m, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p])
 
3.24.73.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(645\) vs. \(2(297)=594\).

Time = 0.44 (sec) , antiderivative size = 646, normalized size of antiderivative = 2.12

method result size
default \(\frac {-\frac {c \left (3 a b \,e^{2} g -4 a c d e g -2 a c \,e^{2} f -2 b^{2} d e g -b^{2} e^{2} f +3 b c \,d^{2} g +6 b c d e f -6 c^{2} d^{2} f \right ) x^{3}}{16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}}-\frac {\left (16 a^{2} c^{2} e^{2} g +a \,b^{2} c \,e^{2} g -12 a b \,c^{2} d e g -6 a b \,c^{2} e^{2} f +b^{4} e^{2} g -6 b^{3} c d e g -3 b^{3} c \,e^{2} f +9 b^{2} c^{2} d^{2} g +18 b^{2} c^{2} d e f -18 b \,c^{3} d^{2} f \right ) x^{2}}{2 c \left (16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}\right )}-\frac {\left (5 a^{2} b c \,e^{2} g +4 a^{2} c^{2} d e g +2 a^{2} c^{2} e^{2} f +a \,b^{3} e^{2} g -10 a \,b^{2} c d e g -5 a \,b^{2} c \,e^{2} f +5 a b \,c^{2} d^{2} g +10 a b \,c^{2} d e f -10 a \,c^{3} d^{2} f +b^{3} c \,d^{2} g +2 b^{3} c d e f -2 b^{2} c^{2} d^{2} f \right ) x}{c \left (16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}\right )}-\frac {8 a^{3} c \,e^{2} g +a^{2} b^{2} e^{2} g -12 a^{2} b c d e g -6 a^{2} b c \,e^{2} f +8 a^{2} c^{2} d^{2} g +16 a^{2} c^{2} d e f +a \,b^{2} c \,d^{2} g +2 a \,b^{2} c d e f -10 a b \,c^{2} d^{2} f +b^{3} c \,d^{2} f}{2 c \left (16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}\right )}}{\left (c \,x^{2}+b x +a \right )^{2}}-\frac {2 \left (3 a b \,e^{2} g -4 a c d e g -2 a c \,e^{2} f -2 b^{2} d e g -b^{2} e^{2} f +3 b c \,d^{2} g +6 b c d e f -6 c^{2} d^{2} f \right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (16 a^{2} c^{2}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ar 
ctan((2*c*x+b)/(4*a*c-b^2)^(1/2))
 
3.24.73.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1443 vs. \(2 (297) = 594\).

Time = 0.58 (sec) , antiderivative size = 2906, normalized size of antiderivative = 9.53 \[ \int \frac {(d+e x)^2 (f+g x)}{\left (a+b x+c x^2\right )^3} \, dx=\text {Too large to display} \]

input
integrate((e*x+d)^2*(g*x+f)/(c*x^2+b*x+a)^3,x, algorithm="fricas")
 
output
[1/2*(2*((6*(b^2*c^4 - 4*a*c^5)*d^2 - 6*(b^3*c^3 - 4*a*b*c^4)*d*e + (b^4*c 
^2 - 2*a*b^2*c^3 - 8*a^2*c^4)*e^2)*f - (3*(b^3*c^3 - 4*a*b*c^4)*d^2 - 2*(b 
^4*c^2 - 2*a*b^2*c^3 - 8*a^2*c^4)*d*e + 3*(a*b^3*c^2 - 4*a^2*b*c^3)*e^2)*g 
)*x^3 + (3*(6*(b^3*c^3 - 4*a*b*c^4)*d^2 - 6*(b^4*c^2 - 4*a*b^2*c^3)*d*e + 
(b^5*c - 2*a*b^3*c^2 - 8*a^2*b*c^3)*e^2)*f - (9*(b^4*c^2 - 4*a*b^2*c^3)*d^ 
2 - 6*(b^5*c - 2*a*b^3*c^2 - 8*a^2*b*c^3)*d*e + (b^6 - 3*a*b^4*c + 12*a^2* 
b^2*c^2 - 64*a^3*c^3)*e^2)*g)*x^2 - 2*(((6*c^5*d^2 - 6*b*c^4*d*e + (b^2*c^ 
3 + 2*a*c^4)*e^2)*f - (3*b*c^4*d^2 + 3*a*b*c^3*e^2 - 2*(b^2*c^3 + 2*a*c^4) 
*d*e)*g)*x^4 + 2*((6*b*c^4*d^2 - 6*b^2*c^3*d*e + (b^3*c^2 + 2*a*b*c^3)*e^2 
)*f - (3*b^2*c^3*d^2 + 3*a*b^2*c^2*e^2 - 2*(b^3*c^2 + 2*a*b*c^3)*d*e)*g)*x 
^3 + ((6*(b^2*c^3 + 2*a*c^4)*d^2 - 6*(b^3*c^2 + 2*a*b*c^3)*d*e + (b^4*c + 
4*a*b^2*c^2 + 4*a^2*c^3)*e^2)*f - (3*(b^3*c^2 + 2*a*b*c^3)*d^2 - 2*(b^4*c 
+ 4*a*b^2*c^2 + 4*a^2*c^3)*d*e + 3*(a*b^3*c + 2*a^2*b*c^2)*e^2)*g)*x^2 + ( 
6*a^2*c^3*d^2 - 6*a^2*b*c^2*d*e + (a^2*b^2*c + 2*a^3*c^2)*e^2)*f - (3*a^2* 
b*c^2*d^2 + 3*a^3*b*c*e^2 - 2*(a^2*b^2*c + 2*a^3*c^2)*d*e)*g + 2*((6*a*b*c 
^3*d^2 - 6*a*b^2*c^2*d*e + (a*b^3*c + 2*a^2*b*c^2)*e^2)*f - (3*a*b^2*c^2*d 
^2 + 3*a^2*b^2*c*e^2 - 2*(a*b^3*c + 2*a^2*b*c^2)*d*e)*g)*x)*sqrt(b^2 - 4*a 
*c)*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c + sqrt(b^2 - 4*a*c)*(2*c*x + b) 
)/(c*x^2 + b*x + a)) - ((b^5*c - 14*a*b^3*c^2 + 40*a^2*b*c^3)*d^2 + 2*(a*b 
^4*c + 4*a^2*b^2*c^2 - 32*a^3*c^3)*d*e - 6*(a^2*b^3*c - 4*a^3*b*c^2)*e^...
 
3.24.73.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2076 vs. \(2 (309) = 618\).

Time = 56.99 (sec) , antiderivative size = 2076, normalized size of antiderivative = 6.81 \[ \int \frac {(d+e x)^2 (f+g x)}{\left (a+b x+c x^2\right )^3} \, dx=\text {Too large to display} \]

input
integrate((e*x+d)**2*(g*x+f)/(c*x**2+b*x+a)**3,x)
 
output
sqrt(-1/(4*a*c - b**2)**5)*(3*a*b*e**2*g - 4*a*c*d*e*g - 2*a*c*e**2*f - 2* 
b**2*d*e*g - b**2*e**2*f + 3*b*c*d**2*g + 6*b*c*d*e*f - 6*c**2*d**2*f)*log 
(x + (-64*a**3*c**3*sqrt(-1/(4*a*c - b**2)**5)*(3*a*b*e**2*g - 4*a*c*d*e*g 
 - 2*a*c*e**2*f - 2*b**2*d*e*g - b**2*e**2*f + 3*b*c*d**2*g + 6*b*c*d*e*f 
- 6*c**2*d**2*f) + 48*a**2*b**2*c**2*sqrt(-1/(4*a*c - b**2)**5)*(3*a*b*e** 
2*g - 4*a*c*d*e*g - 2*a*c*e**2*f - 2*b**2*d*e*g - b**2*e**2*f + 3*b*c*d**2 
*g + 6*b*c*d*e*f - 6*c**2*d**2*f) - 12*a*b**4*c*sqrt(-1/(4*a*c - b**2)**5) 
*(3*a*b*e**2*g - 4*a*c*d*e*g - 2*a*c*e**2*f - 2*b**2*d*e*g - b**2*e**2*f + 
 3*b*c*d**2*g + 6*b*c*d*e*f - 6*c**2*d**2*f) + 3*a*b**2*e**2*g - 4*a*b*c*d 
*e*g - 2*a*b*c*e**2*f + b**6*sqrt(-1/(4*a*c - b**2)**5)*(3*a*b*e**2*g - 4* 
a*c*d*e*g - 2*a*c*e**2*f - 2*b**2*d*e*g - b**2*e**2*f + 3*b*c*d**2*g + 6*b 
*c*d*e*f - 6*c**2*d**2*f) - 2*b**3*d*e*g - b**3*e**2*f + 3*b**2*c*d**2*g + 
 6*b**2*c*d*e*f - 6*b*c**2*d**2*f)/(6*a*b*c*e**2*g - 8*a*c**2*d*e*g - 4*a* 
c**2*e**2*f - 4*b**2*c*d*e*g - 2*b**2*c*e**2*f + 6*b*c**2*d**2*g + 12*b*c* 
*2*d*e*f - 12*c**3*d**2*f)) - sqrt(-1/(4*a*c - b**2)**5)*(3*a*b*e**2*g - 4 
*a*c*d*e*g - 2*a*c*e**2*f - 2*b**2*d*e*g - b**2*e**2*f + 3*b*c*d**2*g + 6* 
b*c*d*e*f - 6*c**2*d**2*f)*log(x + (64*a**3*c**3*sqrt(-1/(4*a*c - b**2)**5 
)*(3*a*b*e**2*g - 4*a*c*d*e*g - 2*a*c*e**2*f - 2*b**2*d*e*g - b**2*e**2*f 
+ 3*b*c*d**2*g + 6*b*c*d*e*f - 6*c**2*d**2*f) - 48*a**2*b**2*c**2*sqrt(-1/ 
(4*a*c - b**2)**5)*(3*a*b*e**2*g - 4*a*c*d*e*g - 2*a*c*e**2*f - 2*b**2*...
 
3.24.73.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {(d+e x)^2 (f+g x)}{\left (a+b x+c x^2\right )^3} \, dx=\text {Exception raised: ValueError} \]

input
integrate((e*x+d)^2*(g*x+f)/(c*x^2+b*x+a)^3,x, algorithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` for 
 more deta
 
3.24.73.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 647 vs. \(2 (297) = 594\).

Time = 0.31 (sec) , antiderivative size = 647, normalized size of antiderivative = 2.12 \[ \int \frac {(d+e x)^2 (f+g x)}{\left (a+b x+c x^2\right )^3} \, dx=\frac {2 \, {\left (6 \, c^{2} d^{2} f - 6 \, b c d e f + b^{2} e^{2} f + 2 \, a c e^{2} f - 3 \, b c d^{2} g + 2 \, b^{2} d e g + 4 \, a c d e g - 3 \, a b e^{2} g\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{{\left (b^{4} - 8 \, a b^{2} c + 16 \, a^{2} c^{2}\right )} \sqrt {-b^{2} + 4 \, a c}} + \frac {12 \, c^{4} d^{2} f x^{3} - 12 \, b c^{3} d e f x^{3} + 2 \, b^{2} c^{2} e^{2} f x^{3} + 4 \, a c^{3} e^{2} f x^{3} - 6 \, b c^{3} d^{2} g x^{3} + 4 \, b^{2} c^{2} d e g x^{3} + 8 \, a c^{3} d e g x^{3} - 6 \, a b c^{2} e^{2} g x^{3} + 18 \, b c^{3} d^{2} f x^{2} - 18 \, b^{2} c^{2} d e f x^{2} + 3 \, b^{3} c e^{2} f x^{2} + 6 \, a b c^{2} e^{2} f x^{2} - 9 \, b^{2} c^{2} d^{2} g x^{2} + 6 \, b^{3} c d e g x^{2} + 12 \, a b c^{2} d e g x^{2} - b^{4} e^{2} g x^{2} - a b^{2} c e^{2} g x^{2} - 16 \, a^{2} c^{2} e^{2} g x^{2} + 4 \, b^{2} c^{2} d^{2} f x + 20 \, a c^{3} d^{2} f x - 4 \, b^{3} c d e f x - 20 \, a b c^{2} d e f x + 10 \, a b^{2} c e^{2} f x - 4 \, a^{2} c^{2} e^{2} f x - 2 \, b^{3} c d^{2} g x - 10 \, a b c^{2} d^{2} g x + 20 \, a b^{2} c d e g x - 8 \, a^{2} c^{2} d e g x - 2 \, a b^{3} e^{2} g x - 10 \, a^{2} b c e^{2} g x - b^{3} c d^{2} f + 10 \, a b c^{2} d^{2} f - 2 \, a b^{2} c d e f - 16 \, a^{2} c^{2} d e f + 6 \, a^{2} b c e^{2} f - a b^{2} c d^{2} g - 8 \, a^{2} c^{2} d^{2} g + 12 \, a^{2} b c d e g - a^{2} b^{2} e^{2} g - 8 \, a^{3} c e^{2} g}{2 \, {\left (b^{4} c - 8 \, a b^{2} c^{2} + 16 \, a^{2} c^{3}\right )} {\left (c x^{2} + b x + a\right )}^{2}} \]

input
integrate((e*x+d)^2*(g*x+f)/(c*x^2+b*x+a)^3,x, algorithm="giac")
 
output
2*(6*c^2*d^2*f - 6*b*c*d*e*f + b^2*e^2*f + 2*a*c*e^2*f - 3*b*c*d^2*g + 2*b 
^2*d*e*g + 4*a*c*d*e*g - 3*a*b*e^2*g)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c 
))/((b^4 - 8*a*b^2*c + 16*a^2*c^2)*sqrt(-b^2 + 4*a*c)) + 1/2*(12*c^4*d^2*f 
*x^3 - 12*b*c^3*d*e*f*x^3 + 2*b^2*c^2*e^2*f*x^3 + 4*a*c^3*e^2*f*x^3 - 6*b* 
c^3*d^2*g*x^3 + 4*b^2*c^2*d*e*g*x^3 + 8*a*c^3*d*e*g*x^3 - 6*a*b*c^2*e^2*g* 
x^3 + 18*b*c^3*d^2*f*x^2 - 18*b^2*c^2*d*e*f*x^2 + 3*b^3*c*e^2*f*x^2 + 6*a* 
b*c^2*e^2*f*x^2 - 9*b^2*c^2*d^2*g*x^2 + 6*b^3*c*d*e*g*x^2 + 12*a*b*c^2*d*e 
*g*x^2 - b^4*e^2*g*x^2 - a*b^2*c*e^2*g*x^2 - 16*a^2*c^2*e^2*g*x^2 + 4*b^2* 
c^2*d^2*f*x + 20*a*c^3*d^2*f*x - 4*b^3*c*d*e*f*x - 20*a*b*c^2*d*e*f*x + 10 
*a*b^2*c*e^2*f*x - 4*a^2*c^2*e^2*f*x - 2*b^3*c*d^2*g*x - 10*a*b*c^2*d^2*g* 
x + 20*a*b^2*c*d*e*g*x - 8*a^2*c^2*d*e*g*x - 2*a*b^3*e^2*g*x - 10*a^2*b*c* 
e^2*g*x - b^3*c*d^2*f + 10*a*b*c^2*d^2*f - 2*a*b^2*c*d*e*f - 16*a^2*c^2*d* 
e*f + 6*a^2*b*c*e^2*f - a*b^2*c*d^2*g - 8*a^2*c^2*d^2*g + 12*a^2*b*c*d*e*g 
 - a^2*b^2*e^2*g - 8*a^3*c*e^2*g)/((b^4*c - 8*a*b^2*c^2 + 16*a^2*c^3)*(c*x 
^2 + b*x + a)^2)
 
3.24.73.9 Mupad [B] (verification not implemented)

Time = 12.38 (sec) , antiderivative size = 913, normalized size of antiderivative = 2.99 \[ \int \frac {(d+e x)^2 (f+g x)}{\left (a+b x+c x^2\right )^3} \, dx=\frac {2\,\mathrm {atan}\left (\frac {\left (\frac {2\,c\,x\,\left (2\,g\,b^2\,d\,e+f\,b^2\,e^2-3\,g\,b\,c\,d^2-6\,f\,b\,c\,d\,e-3\,a\,g\,b\,e^2+6\,f\,c^2\,d^2+4\,a\,g\,c\,d\,e+2\,a\,f\,c\,e^2\right )}{{\left (4\,a\,c-b^2\right )}^{5/2}}+\frac {\left (16\,a^2\,b\,c^2-8\,a\,b^3\,c+b^5\right )\,\left (2\,g\,b^2\,d\,e+f\,b^2\,e^2-3\,g\,b\,c\,d^2-6\,f\,b\,c\,d\,e-3\,a\,g\,b\,e^2+6\,f\,c^2\,d^2+4\,a\,g\,c\,d\,e+2\,a\,f\,c\,e^2\right )}{{\left (4\,a\,c-b^2\right )}^{5/2}\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}\right )\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}{2\,g\,b^2\,d\,e+f\,b^2\,e^2-3\,g\,b\,c\,d^2-6\,f\,b\,c\,d\,e-3\,a\,g\,b\,e^2+6\,f\,c^2\,d^2+4\,a\,g\,c\,d\,e+2\,a\,f\,c\,e^2}\right )\,\left (2\,g\,b^2\,d\,e+f\,b^2\,e^2-3\,g\,b\,c\,d^2-6\,f\,b\,c\,d\,e-3\,a\,g\,b\,e^2+6\,f\,c^2\,d^2+4\,a\,g\,c\,d\,e+2\,a\,f\,c\,e^2\right )}{{\left (4\,a\,c-b^2\right )}^{5/2}}-\frac {\frac {8\,g\,a^3\,c\,e^2+g\,a^2\,b^2\,e^2-12\,g\,a^2\,b\,c\,d\,e-6\,f\,a^2\,b\,c\,e^2+8\,g\,a^2\,c^2\,d^2+16\,f\,a^2\,c^2\,d\,e+g\,a\,b^2\,c\,d^2+2\,f\,a\,b^2\,c\,d\,e-10\,f\,a\,b\,c^2\,d^2+f\,b^3\,c\,d^2}{2\,c\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}+\frac {x^2\,\left (16\,g\,a^2\,c^2\,e^2+g\,a\,b^2\,c\,e^2-12\,g\,a\,b\,c^2\,d\,e-6\,f\,a\,b\,c^2\,e^2+g\,b^4\,e^2-6\,g\,b^3\,c\,d\,e-3\,f\,b^3\,c\,e^2+9\,g\,b^2\,c^2\,d^2+18\,f\,b^2\,c^2\,d\,e-18\,f\,b\,c^3\,d^2\right )}{2\,c\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}+\frac {x\,\left (5\,g\,a^2\,b\,c\,e^2+4\,g\,a^2\,c^2\,d\,e+2\,f\,a^2\,c^2\,e^2+g\,a\,b^3\,e^2-10\,g\,a\,b^2\,c\,d\,e-5\,f\,a\,b^2\,c\,e^2+5\,g\,a\,b\,c^2\,d^2+10\,f\,a\,b\,c^2\,d\,e-10\,f\,a\,c^3\,d^2+g\,b^3\,c\,d^2+2\,f\,b^3\,c\,d\,e-2\,f\,b^2\,c^2\,d^2\right )}{c\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}-\frac {c\,x^3\,\left (2\,g\,b^2\,d\,e+f\,b^2\,e^2-3\,g\,b\,c\,d^2-6\,f\,b\,c\,d\,e-3\,a\,g\,b\,e^2+6\,f\,c^2\,d^2+4\,a\,g\,c\,d\,e+2\,a\,f\,c\,e^2\right )}{16\,a^2\,c^2-8\,a\,b^2\,c+b^4}}{x^2\,\left (b^2+2\,a\,c\right )+a^2+c^2\,x^4+2\,a\,b\,x+2\,b\,c\,x^3} \]

input
int(((f + g*x)*(d + e*x)^2)/(a + b*x + c*x^2)^3,x)
 
output
(2*atan((((2*c*x*(b^2*e^2*f + 6*c^2*d^2*f - 3*a*b*e^2*g + 2*a*c*e^2*f - 3* 
b*c*d^2*g + 2*b^2*d*e*g + 4*a*c*d*e*g - 6*b*c*d*e*f))/(4*a*c - b^2)^(5/2) 
+ ((b^5 + 16*a^2*b*c^2 - 8*a*b^3*c)*(b^2*e^2*f + 6*c^2*d^2*f - 3*a*b*e^2*g 
 + 2*a*c*e^2*f - 3*b*c*d^2*g + 2*b^2*d*e*g + 4*a*c*d*e*g - 6*b*c*d*e*f))/( 
(4*a*c - b^2)^(5/2)*(b^4 + 16*a^2*c^2 - 8*a*b^2*c)))*(b^4 + 16*a^2*c^2 - 8 
*a*b^2*c))/(b^2*e^2*f + 6*c^2*d^2*f - 3*a*b*e^2*g + 2*a*c*e^2*f - 3*b*c*d^ 
2*g + 2*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